

import time
from env_init.environment import deliveryManEnv
import Config
from Agent.Astar.AstarBlock import *

def blockValue(env, player):

    effiScore = None
    biggestH = None
    biggestV = None

    for h in range(4,12):
        for v in range(4, 12):
            lenTemp, rewardTemp = AStarRewardBlockValue(env, list(range(h-3, h+1)), list(range(v-3,v+1)), player)
            if rewardTemp != 0:
                if effiScore == None:
                   effiScore = rewardTemp/(lenTemp)
                   biggestH = h
                   biggestV = v
                else:
                   effiScoreTemp = rewardTemp/(lenTemp)
                   if effiScoreTemp > effiScore:
                       effiScore = effiScoreTemp
                       biggestH = h
                       biggestV = v

    return AStarRewardBlock(env, list(range(biggestH-3, biggestH+1)), list(range(biggestV-3,biggestV+1)), player)












